define(['jquery', 'jqx-all'], function($) {
	function dynaWindow(element, name, param) {
		var self = this;
        self.winId = Math.random().toString(36).substr(2, 6) + '-' + name;
		var jqxWin = $("<" + name + "></" + name + ">");
		var params = 'id: \"' + self.winId + '\"';
		if (param) {
			params = params + ', ' + param;
		}
		jqxWin.attr('params', params);
        jqxWin.appendTo(element);
	}
	
	dynaWindow.prototype.show = function() {
		$('#'+this.winId).jqxWindow('open');
	}
	
	return dynaWindow;
})